# 1. 遍历键（默认方式）
person = {"name": "Alice", "age": 30, "city": "New York"}
for key in person:  # 等价于：for key in person.keys():
    print(key)
# 输出：name, age, city

# 2. 遍历值
for value in person.values():
    print(value)
# 输出：Alice, 30, New York

# 3. 同时遍历键和值
for key, value in person.items():
    print(f"{key}: {value}")
# 输出：
# name: Alice
# age: 30
# city: New York
